package com.amkai.mobile.common.job.scheduler;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.amkai.mobile.common.job.MobileJob;

/**
 * 
 * @author lkovari
 * 
 */
public class MobileSchedulerJob extends MobileJob {
	private static final long serialVersionUID = 9097223443016643886L;
	private MobileSchedulerJobKind mobileSchedulerJobKind;
	private int appointmentDayOfTheYear;
	private int appointmentYear;
	private Long physstaffId;
	private Long appointmentId;
	private Long time;
	private List<Long> depIds = new ArrayList<Long>();

	public static MobileSchedulerJob appointmentsBriefBySurgeonAndTimeRange(Long departmentId, long physId, int appYear, int appDoy ) {
		MobileSchedulerJob result = new MobileSchedulerJob();
		result.setMobileSchedulerJobKind(MobileSchedulerJobKind.DOWNLOAD_APPOINTMENTS_AS_BRIEF_BY_TIMERANGE_AND_SURGEON);
//		result.setDepartmentId(departmentId);
		result.setPhysstaffId(physId);
		result.setAppointmentYear(appYear);
		result.setAppointmentDayOfTheYear(appDoy);
		result.getDepIds().add(departmentId);
		return result;

	}

//	public static MobileSchedulerJob nearestAppointmentBriefBySurgeonAndTime(Long departmentId, long physId, Date time) {
	public static MobileSchedulerJob nearestAppointmentBriefBySurgeonAndTime(long physId, Date time) {		
		MobileSchedulerJob result = new MobileSchedulerJob();
		result.setMobileSchedulerJobKind(MobileSchedulerJobKind.DOWNLOAD_NEAREST_APPOINTMENT_BRIEF);
//		result.setDepartmentId(departmentId);
		result.setPhysstaffId(physId);
		result.setTime(time.getTime());
		return result;
	}

	public static MobileSchedulerJob caseDetailsById(Long appointmentId) {
		MobileSchedulerJob result = new MobileSchedulerJob();
		result.setMobileSchedulerJobKind(MobileSchedulerJobKind.DOWNLOAD_CASE_DETAILS_BY_ID);
		result.setAppointmentId(appointmentId);
		return result;
	}

	public static MobileSchedulerJob patientDetailsById(Long appointmentId) {
		MobileSchedulerJob result = new MobileSchedulerJob();
		result.setMobileSchedulerJobKind(MobileSchedulerJobKind.DOWNLOAD_PATIENT_DETAILS_BY_ID);
		result.setAppointmentId(appointmentId);
		return result;
	}

	public static MobileSchedulerJob appointmentKindById(Long appointmentId) {
		MobileSchedulerJob result = new MobileSchedulerJob();
		result.setMobileSchedulerJobKind(MobileSchedulerJobKind.DOWNLOAD_APPT_KIND);
		result.setAppointmentId(appointmentId);
		return result;

	}

	public static MobileSchedulerJob appointmentDetailsById(Long appointmentId) {
		MobileSchedulerJob result = new MobileSchedulerJob();
		result.setMobileSchedulerJobKind(MobileSchedulerJobKind.DOWNLOAD_APPOINTMENT_DETAILS_BY_ID);
		result.setAppointmentId(appointmentId);
		return result;

	}

	public MobileSchedulerJobKind getMobileSchedulerJobKind() {
		return mobileSchedulerJobKind;
	}

	public void setMobileSchedulerJobKind(MobileSchedulerJobKind mobileSchedulerJobKind) {
		this.mobileSchedulerJobKind = mobileSchedulerJobKind;
	}

	public long getPhysstaffId() {
		return physstaffId;
	}

	public void setPhysstaffId(long physstaffId) {
		this.physstaffId = physstaffId;
	}

	

	public long getAppointmentId() {
		return appointmentId;
	}

	public void setAppointmentId(long appointmentId) {
		this.appointmentId = appointmentId;
	}

	public void setTime(Long time) {
		this.time = time;
	}

	public Long getTime() {
		return time;
	}

	public void setAppointmentDayOfTheYear(int appointmentDayOfTheYear) {
		this.appointmentDayOfTheYear = appointmentDayOfTheYear;
	}

	public int getAppointmentDayOfTheYear() {
		return appointmentDayOfTheYear;
	}

	public void setAppointmentYear(int appointmentYear) {
		this.appointmentYear = appointmentYear;
	}

	public int getAppointmentYear() {
		return appointmentYear;
	}
	
	public List<Long> getDepIds() {
		return depIds;
	}
	
	public void setDepIds(List<Long> depIds) {
		this.depIds = depIds;
	}
}
